package bairui.international.model.domain.jpa;

import com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue;

/**
 *
 * (分公司)TB_BranchCompany
 *
 * @说明
 * <pre>

 * </pre>
 *
 * @see Help_TB_BranchCompany#inheritance() 继承体系信息
 *
 */
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate

@javax.persistence.Entity(name="t_branchCompany")
@com.lianjing.sh.processing.info.annotation.GenerateInfoModel
@SuppressWarnings("serial")
@com.lianjing.sh.model.common.annotation.Comment("分公司")
@com.lianjing.sh.processing.info.annotation.InfoComment("分公司")
public class TB_BranchCompany
 extends TBSuper_BaseIDAndTimeAndOrderValue
 implements 
	com.lianjing.sh.model.common.stardard.TableModel<Long>,
	com.sh_lianjing.state.HasStatable,
	java.io.Serializable

{

	
	
	/**
	 * 必须属性赋值接口
	 */
	public static interface MustProperties{
		/** 代码 */
		public String getNumber();
		/** 名称 */
		public String getName();
		/** 电话 */
		public String getPhone();
		/** 状态 */
		public com.lianjing.sh.model.uml.model.status.State_UpDown getState();
		/** 总金额 */
		public Double getMoney();
		/** 可提现总金额 */
		public Double getWithdrawMoney();
	}
	
	/**
	 * 为必须属性赋值
	 */
	public TB_BranchCompany properties(MustProperties properties) {
		this.setNumber(properties.getNumber());
		this.setName(properties.getName());
		this.setPhone(properties.getPhone());
		this.setState(properties.getState());
		this.setMoney(properties.getMoney());
		this.setWithdrawMoney(properties.getWithdrawMoney());
		return this;
	}
	
	/**
	 *	必须属性构造函数
	 */
	public TB_BranchCompany(MustProperties properties) {
		this.properties(properties);
	}
	
	
	/**
	 * 可选单属性赋值接口
	 */
	public static interface OptionalSingleProperties{
		/** 备注 */
		public String getComment();
	}
	
	/**
	 * 为可选单属性赋值
	 */
	public TB_BranchCompany properties(OptionalSingleProperties properties) {
		this.setComment(properties.getComment());
		return this;
	}
	
	
	
	public TB_BranchCompany(MustProperties must, OptionalSingleProperties optionalSingle) {
		this.properties(must);
		this.properties(optionalSingle);
	}
	
	/**
	 * 仅当前必须属性赋值接口
	 */
	public static interface CurrentMustProperties{
		/** 代码 */
		public String getNumber();
		/** 名称 */
		public String getName();
		/** 电话 */
		public String getPhone();
		/** 状态 */
		public com.lianjing.sh.model.uml.model.status.State_UpDown getState();
		/** 总金额 */
		public Double getMoney();
		/** 可提现总金额 */
		public Double getWithdrawMoney();
	}
	
	/**
	 * 为仅当前必须属性赋值
	 */
	public TB_BranchCompany properties(CurrentMustProperties properties) {
		this.setNumber(properties.getNumber());
		this.setName(properties.getName());
		this.setPhone(properties.getPhone());
		this.setState(properties.getState());
		this.setMoney(properties.getMoney());
		this.setWithdrawMoney(properties.getWithdrawMoney());
		return this;
	}
	
	/**
	 * 仅当前可选单属性赋值接口
	 */
	public static interface CurrentOptionalSingleProperties{
		/** 备注 */
		public String getComment();
	}
	
	/**
	 * 为仅当前可选单属性赋值
	 */
	public TB_BranchCompany properties(CurrentOptionalSingleProperties properties) {
		this.setComment(properties.getComment());
		return this;
	}
	
	public TB_BranchCompany(
		@lombok.NonNull com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean,
		CurrentMustProperties mustProperties,
		CurrentOptionalSingleProperties optionalProperties
	) {
		this(bean);
		this.properties(mustProperties);
		this.properties(optionalProperties);
	}
	
	public TB_BranchCompany(
		@lombok.NonNull com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean
	) {
		update(bean);
	}
	
	public TB_BranchCompany update(com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean){
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		return this;
	}
	
	
	/**
	 * 更新属性内部类
	 */
	public abstract class UpdateProperties {
	
		public UpdateProperties() throws Exception {
			Integer orderValue = getOrderValue(TB_BranchCompany.this);
			if(isOverride_getOrderValue){
				TB_BranchCompany.this.setOrderValue(orderValue);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_Town> area = getArea(TB_BranchCompany.this);
			if(isOverride_getArea){
				TB_BranchCompany.this.setArea(area);
			}
	
			String number = getNumber(TB_BranchCompany.this);
			if(isOverride_getNumber){
				TB_BranchCompany.this.setNumber(number);
			}
	
			String name = getName(TB_BranchCompany.this);
			if(isOverride_getName){
				TB_BranchCompany.this.setName(name);
			}
	
			String comment = getComment(TB_BranchCompany.this);
			if(isOverride_getComment){
				TB_BranchCompany.this.setComment(comment);
			}
	
			String phone = getPhone(TB_BranchCompany.this);
			if(isOverride_getPhone){
				TB_BranchCompany.this.setPhone(phone);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyStaff> branchCompanyStaffs = getBranchCompanyStaffs(TB_BranchCompany.this);
			if(isOverride_getBranchCompanyStaffs){
				TB_BranchCompany.this.setBranchCompanyStaffs(branchCompanyStaffs);
			}
	
			com.lianjing.sh.model.uml.model.status.State_UpDown state = getState(TB_BranchCompany.this);
			if(isOverride_getState){
				TB_BranchCompany.this.setState(state);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_ProductOrder> productOrders = getProductOrders(TB_BranchCompany.this);
			if(isOverride_getProductOrders){
				TB_BranchCompany.this.setProductOrders(productOrders);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord> branchCompanyMoneyRecords = getBranchCompanyMoneyRecords(TB_BranchCompany.this);
			if(isOverride_getBranchCompanyMoneyRecords){
				TB_BranchCompany.this.setBranchCompanyMoneyRecords(branchCompanyMoneyRecords);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyWithdrawOrder> branchCompanyWithdrawOrders = getBranchCompanyWithdrawOrders(TB_BranchCompany.this);
			if(isOverride_getBranchCompanyWithdrawOrders){
				TB_BranchCompany.this.setBranchCompanyWithdrawOrders(branchCompanyWithdrawOrders);
			}
	
			Double money = getMoney(TB_BranchCompany.this);
			if(isOverride_getMoney){
				TB_BranchCompany.this.setMoney(money);
			}
	
			Double withdrawMoney = getWithdrawMoney(TB_BranchCompany.this);
			if(isOverride_getWithdrawMoney){
				TB_BranchCompany.this.setWithdrawMoney(withdrawMoney);
			}
		}
	
		public TB_BranchCompany up(){
			return TB_BranchCompany.this;
		}
	
		/** 排序值 */
		private boolean isOverride_getOrderValue = true;
		public Integer getOrderValue(TB_BranchCompany it) throws Exception { 
			isOverride_getOrderValue = false; 
			return null;
		}
		/** 区域 */
		private boolean isOverride_getArea = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_Town> getArea(TB_BranchCompany it) throws Exception { 
			isOverride_getArea = false; 
			return null;
		}
		/** 代码 */
		private boolean isOverride_getNumber = true;
		public String getNumber(TB_BranchCompany it) throws Exception { 
			isOverride_getNumber = false; 
			return null;
		}
		/** 名称 */
		private boolean isOverride_getName = true;
		public String getName(TB_BranchCompany it) throws Exception { 
			isOverride_getName = false; 
			return null;
		}
		/** 备注 */
		private boolean isOverride_getComment = true;
		public String getComment(TB_BranchCompany it) throws Exception { 
			isOverride_getComment = false; 
			return null;
		}
		/** 电话 */
		private boolean isOverride_getPhone = true;
		public String getPhone(TB_BranchCompany it) throws Exception { 
			isOverride_getPhone = false; 
			return null;
		}
		/** 分公司员工 */
		private boolean isOverride_getBranchCompanyStaffs = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyStaff> getBranchCompanyStaffs(TB_BranchCompany it) throws Exception { 
			isOverride_getBranchCompanyStaffs = false; 
			return null;
		}
		/** 状态 */
		private boolean isOverride_getState = true;
		public com.lianjing.sh.model.uml.model.status.State_UpDown getState(TB_BranchCompany it) throws Exception { 
			isOverride_getState = false; 
			return null;
		}
		/** 产品订单 */
		private boolean isOverride_getProductOrders = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_ProductOrder> getProductOrders(TB_BranchCompany it) throws Exception { 
			isOverride_getProductOrders = false; 
			return null;
		}
		/** 分公司金额记录 */
		private boolean isOverride_getBranchCompanyMoneyRecords = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord> getBranchCompanyMoneyRecords(TB_BranchCompany it) throws Exception { 
			isOverride_getBranchCompanyMoneyRecords = false; 
			return null;
		}
		/** 分公司提现单 */
		private boolean isOverride_getBranchCompanyWithdrawOrders = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyWithdrawOrder> getBranchCompanyWithdrawOrders(TB_BranchCompany it) throws Exception { 
			isOverride_getBranchCompanyWithdrawOrders = false; 
			return null;
		}
		/** 总金额 */
		private boolean isOverride_getMoney = true;
		public Double getMoney(TB_BranchCompany it) throws Exception { 
			isOverride_getMoney = false; 
			return null;
		}
		/** 可提现总金额 */
		private boolean isOverride_getWithdrawMoney = true;
		public Double getWithdrawMoney(TB_BranchCompany it) throws Exception { 
			isOverride_getWithdrawMoney = false; 
			return null;
		}
	
	}
	
	
	/**
	 * 构造函数
	 */
	public TB_BranchCompany() {
	}
	
	public TB_BranchCompany(
		@lombok.NonNull Long id
	) {
		this.setId(id);
	}
	
	public TB_BranchCompany(
		@lombok.NonNull TB_BranchCompany bean
	) {
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		this.setArea(bean.getArea());
		this.setNumber(bean.getNumber());
		this.setName(bean.getName());
		this.setComment(bean.getComment());
		this.setPhone(bean.getPhone());
		this.setBranchCompanyStaffs(bean.getBranchCompanyStaffs());
		this.setState(bean.getState());
		this.setProductOrders(bean.getProductOrders());
		this.setCreator(bean.getCreator());
		this.setLastModifier(bean.getLastModifier());
		this.setBranchCompanyMoneyRecords(bean.getBranchCompanyMoneyRecords());
		this.setBranchCompanyWithdrawOrders(bean.getBranchCompanyWithdrawOrders());
		this.setMoney(bean.getMoney());
		this.setWithdrawMoney(bean.getWithdrawMoney());
	}
	
	

	


	/**
	 * 属性
	 */
	@com.lianjing.sh.model.common.annotation.Comment("区域")
	@com.lianjing.sh.processing.info.annotation.InfoComment("区域")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="branchCompany")
	private java.util.List<bairui.international.model.domain.jpa.TB_Town> area;

	@com.lianjing.sh.model.common.annotation.Comment("代码")
	@com.lianjing.sh.processing.info.annotation.InfoComment("代码")
	@javax.persistence.Column(name="number", nullable=false, length=32)
	private String number;

	@com.lianjing.sh.model.common.annotation.Comment("名称")
	@com.lianjing.sh.processing.info.annotation.InfoComment("名称")
	@javax.persistence.Column(name="name", nullable=false, length=255)
	private String name;

	@com.lianjing.sh.model.common.annotation.Comment("备注")
	@com.lianjing.sh.processing.info.annotation.InfoComment("备注")
	@javax.persistence.Column(name="comment", length=255)
	private String comment;

	@com.lianjing.sh.model.common.annotation.Comment("电话")
	@com.lianjing.sh.processing.info.annotation.InfoComment("电话")
	@javax.persistence.Column(name="phone", nullable=false, length=20)
	private String phone;

	@com.lianjing.sh.model.common.annotation.Comment("分公司员工")
	@com.lianjing.sh.processing.info.annotation.InfoComment("分公司员工")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="branchCompany")
	private java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyStaff> branchCompanyStaffs;

	@com.lianjing.sh.model.common.annotation.Comment("状态")
	@com.lianjing.sh.processing.info.annotation.InfoComment("状态")
	@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)
	@javax.persistence.Column(name="state", nullable=false)
	private com.lianjing.sh.model.uml.model.status.State_UpDown state;

	@com.lianjing.sh.model.common.annotation.Comment("产品订单")
	@com.lianjing.sh.processing.info.annotation.InfoComment("产品订单")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="branchCompany")
	private java.util.List<bairui.international.model.domain.jpa.TB_ProductOrder> productOrders;

	@com.lianjing.sh.model.common.annotation.Comment("创建者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("创建者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="creator_id", nullable=true)
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_Admin creator;

	@com.lianjing.sh.model.common.annotation.Comment("最后修改者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("最后修改者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="lastModifier_id", nullable=true)
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_Admin lastModifier;

	@com.lianjing.sh.model.common.annotation.Comment("分公司金额记录")
	@com.lianjing.sh.processing.info.annotation.InfoComment("分公司金额记录")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="branchCompany")
	private java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord> branchCompanyMoneyRecords;

	@com.lianjing.sh.model.common.annotation.Comment("分公司提现单")
	@com.lianjing.sh.processing.info.annotation.InfoComment("分公司提现单")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="branchCompany")
	private java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyWithdrawOrder> branchCompanyWithdrawOrders;

	@com.lianjing.sh.model.common.annotation.Comment("总金额")
	@com.lianjing.sh.processing.info.annotation.InfoComment("总金额")
	@javax.persistence.Column(name="money", nullable=false)
	private Double money;

	@com.lianjing.sh.model.common.annotation.Comment("可提现总金额")
	@com.lianjing.sh.processing.info.annotation.InfoComment("可提现总金额")
	@javax.persistence.Column(name="withdrawMoney", nullable=false)
	private Double withdrawMoney;

	/** get[区域] */
	public java.util.List<bairui.international.model.domain.jpa.TB_Town> getArea() {
		return this.area;
	}

	/** get[代码] */
	public String getNumber() {
		return this.number;
	}

	/** get[名称] */
	public String getName() {
		return this.name;
	}

	/** get[备注] */
	public String getComment() {
		return this.comment;
	}

	/** get[电话] */
	public String getPhone() {
		return this.phone;
	}

	/** get[分公司员工] */
	public java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyStaff> getBranchCompanyStaffs() {
		return this.branchCompanyStaffs;
	}

	/** get[状态] */
	public com.lianjing.sh.model.uml.model.status.State_UpDown getState() {
		return this.state;
	}

	/** get[产品订单] */
	public java.util.List<bairui.international.model.domain.jpa.TB_ProductOrder> getProductOrders() {
		return this.productOrders;
	}

	/** get[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin getCreator() {
		return this.creator;
	}

	/** get[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin getLastModifier() {
		return this.lastModifier;
	}

	/** get[分公司金额记录] */
	public java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord> getBranchCompanyMoneyRecords() {
		return this.branchCompanyMoneyRecords;
	}

	/** get[分公司提现单] */
	public java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyWithdrawOrder> getBranchCompanyWithdrawOrders() {
		return this.branchCompanyWithdrawOrders;
	}

	/** get[总金额] */
	public Double getMoney() {
		return this.money;
	}

	/** get[可提现总金额] */
	public Double getWithdrawMoney() {
		return this.withdrawMoney;
	}

	/** set[区域] */
	public void setArea(java.util.List<bairui.international.model.domain.jpa.TB_Town> area) {
		this.area = area;
	}

	/** set[代码] */
	public void setNumber(String number) {
		this.number = number;
	}

	/** set[名称] */
	public void setName(String name) {
		this.name = name;
	}

	/** set[备注] */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/** set[电话] */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/** set[分公司员工] */
	public void setBranchCompanyStaffs(java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyStaff> branchCompanyStaffs) {
		this.branchCompanyStaffs = branchCompanyStaffs;
	}

	/** set[状态] */
	public void setState(com.lianjing.sh.model.uml.model.status.State_UpDown state) {
		this.state = state;
	}

	/** set[产品订单] */
	public void setProductOrders(java.util.List<bairui.international.model.domain.jpa.TB_ProductOrder> productOrders) {
		this.productOrders = productOrders;
	}

	/** set[创建者] */
	public void setCreator(bairui.international.model.domain.jpa.TB_Admin creator) {
		this.creator = creator;
	}

	/** set[最后修改者] */
	public void setLastModifier(bairui.international.model.domain.jpa.TB_Admin lastModifier) {
		this.lastModifier = lastModifier;
	}

	/** set[分公司金额记录] */
	public void setBranchCompanyMoneyRecords(java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord> branchCompanyMoneyRecords) {
		this.branchCompanyMoneyRecords = branchCompanyMoneyRecords;
	}

	/** set[分公司提现单] */
	public void setBranchCompanyWithdrawOrders(java.util.List<bairui.international.model.domain.jpa.TB_BranchCompanyWithdrawOrder> branchCompanyWithdrawOrders) {
		this.branchCompanyWithdrawOrders = branchCompanyWithdrawOrders;
	}

	/** set[总金额] */
	public void setMoney(Double money) {
		this.money = money;
	}

	/** set[可提现总金额] */
	public void setWithdrawMoney(Double withdrawMoney) {
		this.withdrawMoney = withdrawMoney;
	}








	/** add[Area] */
	public TB_BranchCompany addArea(bairui.international.model.domain.jpa.TB_Town ... area){
		if(this.area == null){
			this.area = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_Town bean : area){
			bean.setBranchCompany(this);
			this.area.add(bean);
		}
		return this;
	}
	/** add[BranchCompanyStaffs] */
	public TB_BranchCompany addBranchCompanyStaffs(bairui.international.model.domain.jpa.TB_BranchCompanyStaff ... branchCompanyStaffs){
		if(this.branchCompanyStaffs == null){
			this.branchCompanyStaffs = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_BranchCompanyStaff bean : branchCompanyStaffs){
			bean.setBranchCompany(this);
			this.branchCompanyStaffs.add(bean);
		}
		return this;
	}
	/** add[ProductOrders] */
	public TB_BranchCompany addProductOrders(bairui.international.model.domain.jpa.TB_ProductOrder ... productOrders){
		if(this.productOrders == null){
			this.productOrders = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_ProductOrder bean : productOrders){
			bean.setBranchCompany(this);
			this.productOrders.add(bean);
		}
		return this;
	}
	/** add[BranchCompanyMoneyRecords] */
	public TB_BranchCompany addBranchCompanyMoneyRecords(bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord ... branchCompanyMoneyRecords){
		if(this.branchCompanyMoneyRecords == null){
			this.branchCompanyMoneyRecords = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord bean : branchCompanyMoneyRecords){
			bean.setBranchCompany(this);
			this.branchCompanyMoneyRecords.add(bean);
		}
		return this;
	}
	/** add[BranchCompanyWithdrawOrders] */
	public TB_BranchCompany addBranchCompanyWithdrawOrders(bairui.international.model.domain.jpa.TB_BranchCompanyWithdrawOrder ... branchCompanyWithdrawOrders){
		if(this.branchCompanyWithdrawOrders == null){
			this.branchCompanyWithdrawOrders = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_BranchCompanyWithdrawOrder bean : branchCompanyWithdrawOrders){
			bean.setBranchCompany(this);
			this.branchCompanyWithdrawOrders.add(bean);
		}
		return this;
	}
	
	/** remove[Area] */
	public TB_BranchCompany removeArea(bairui.international.model.domain.jpa.TB_Town ... area){
		if(this.area == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_Town bean : area){
			bean.setBranchCompany(null);
			this.area.remove(bean);
		}
		return this;
	}
	/** remove[BranchCompanyStaffs] */
	public TB_BranchCompany removeBranchCompanyStaffs(bairui.international.model.domain.jpa.TB_BranchCompanyStaff ... branchCompanyStaffs){
		if(this.branchCompanyStaffs == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_BranchCompanyStaff bean : branchCompanyStaffs){
			bean.setBranchCompany(null);
			this.branchCompanyStaffs.remove(bean);
		}
		return this;
	}
	/** remove[ProductOrders] */
	public TB_BranchCompany removeProductOrders(bairui.international.model.domain.jpa.TB_ProductOrder ... productOrders){
		if(this.productOrders == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_ProductOrder bean : productOrders){
			bean.setBranchCompany(null);
			this.productOrders.remove(bean);
		}
		return this;
	}
	/** remove[BranchCompanyMoneyRecords] */
	public TB_BranchCompany removeBranchCompanyMoneyRecords(bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord ... branchCompanyMoneyRecords){
		if(this.branchCompanyMoneyRecords == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord bean : branchCompanyMoneyRecords){
			bean.setBranchCompany(null);
			this.branchCompanyMoneyRecords.remove(bean);
		}
		return this;
	}
	/** remove[BranchCompanyWithdrawOrders] */
	public TB_BranchCompany removeBranchCompanyWithdrawOrders(bairui.international.model.domain.jpa.TB_BranchCompanyWithdrawOrder ... branchCompanyWithdrawOrders){
		if(this.branchCompanyWithdrawOrders == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_BranchCompanyWithdrawOrder bean : branchCompanyWithdrawOrders){
			bean.setBranchCompany(null);
			this.branchCompanyWithdrawOrders.remove(bean);
		}
		return this;
	}
	
	/**
	 * contains[Area]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsArea(bairui.international.model.domain.jpa.TB_Town ... area){
		if(this.area == null || area==null || area.length<=0){
			return false;
		}
		return this.area.containsAll(java.util.Arrays.asList(area));
	}
	/**
	 * contains[BranchCompanyStaffs]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsBranchCompanyStaffs(bairui.international.model.domain.jpa.TB_BranchCompanyStaff ... branchCompanyStaffs){
		if(this.branchCompanyStaffs == null || branchCompanyStaffs==null || branchCompanyStaffs.length<=0){
			return false;
		}
		return this.branchCompanyStaffs.containsAll(java.util.Arrays.asList(branchCompanyStaffs));
	}
	/**
	 * contains[ProductOrders]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsProductOrders(bairui.international.model.domain.jpa.TB_ProductOrder ... productOrders){
		if(this.productOrders == null || productOrders==null || productOrders.length<=0){
			return false;
		}
		return this.productOrders.containsAll(java.util.Arrays.asList(productOrders));
	}
	/**
	 * contains[BranchCompanyMoneyRecords]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsBranchCompanyMoneyRecords(bairui.international.model.domain.jpa.TB_BranchCompanyMoneyRecord ... branchCompanyMoneyRecords){
		if(this.branchCompanyMoneyRecords == null || branchCompanyMoneyRecords==null || branchCompanyMoneyRecords.length<=0){
			return false;
		}
		return this.branchCompanyMoneyRecords.containsAll(java.util.Arrays.asList(branchCompanyMoneyRecords));
	}
	/**
	 * contains[BranchCompanyWithdrawOrders]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsBranchCompanyWithdrawOrders(bairui.international.model.domain.jpa.TB_BranchCompanyWithdrawOrder ... branchCompanyWithdrawOrders){
		if(this.branchCompanyWithdrawOrders == null || branchCompanyWithdrawOrders==null || branchCompanyWithdrawOrders.length<=0){
			return false;
		}
		return this.branchCompanyWithdrawOrders.containsAll(java.util.Arrays.asList(branchCompanyWithdrawOrders));
	}
	

	/** take[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin takeCreator(){
		if(null == this.creator){
			this.creator = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.creator;
	}
	
	/** take[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin takeLastModifier(){
		if(null == this.lastModifier){
			this.lastModifier = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.lastModifier;
	}
	
	
	/** optional[创建者] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_Admin> optionalCreator() {
		return java.util.Optional.ofNullable(this.creator);
	}
	
	/** optional[最后修改者] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_Admin> optionalLastModifier() {
		return java.util.Optional.ofNullable(this.lastModifier);
	}
	

	/**
	 * 复写 hashCode
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		return prime * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
	}
	
	/**
	 * 复写 equals
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj){
			return true;
		}
		if (obj == null){
			return false;
		}
		if (getClass() != obj.getClass()){
			return false;
		}
		TB_BranchCompany other = (TB_BranchCompany) obj;
		if (this.getId() == null) {
			return false;
		} else if (!this.getId().equals(other.getId())){
			return false;
		}
		return true;
	}
	

	/**
	 * 用来覆盖toString()的输出
	 */
	@javax.persistence.Transient
	private String toString;
	
	public void setToString(String toString) {
		this.toString = toString;
	}
	
	/**
	 * 复写 toString
	 */
	@Override
	public String toString() {
		if(null != this.toString){
			return this.toString;
		}
		String name = this.getName();
		if(null != name){
			return String.valueOf(name);
		}
		return super.toString();
	}	

	@javax.persistence.PrePersist
	public void prePersist() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setCreateTime(new java.util.Date());
		this.setModifyTime(new java.util.Date());
		this.setCreator((bairui.international.model.domain.jpa.TB_Admin)user);
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}
	
	@javax.persistence.PreUpdate
	public void preUpdate() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setModifyTime(new java.util.Date());
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}

	/**
	 * 状态相关
	 */
	public com.lianjing.sh.model.uml.model.status.State_UpDown state(){
		return this.getState();
	}


}
